#-*- coding utf-8 -*-
import smtplib
from email.mime.text import MIMEText


from_addr='248717607@qq.com'
passwd='kczswptsrgkxbjjb'
to_addrs='248717607@qq.com'
                            
subject = "我是一个测试标题"
content = "我是Python SMTP 邮件测试内容"
msg = MIMEText(content)
msg['Subject'] = subject
msg['From'] = from_addr
msg['To'] = to_addrs
try:
    s = smtplib.SMTP_SSL("smtp.qq.com",465)
    s.login(from_addr, passwd)
    s.sendmail(from_addr, to_addrs, msg.as_string())
    print("发送成功")
except s.SMTPException:
    print("发送失败")
finally:
    s.quit()